<html>
<head><meta charset="utf-8"><title>Adding libcore target support to a distro-installed rustc · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Adding.20libcore.20target.20support.20to.20a.20distro-installed.20rustc.html">Adding libcore target support to a distro-installed rustc</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="226642325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Adding%20libcore%20target%20support%20to%20a%20distro-installed%20rustc/near/226642325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Philipp Wagner <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Adding.20libcore.20target.20support.20to.20a.20distro-installed.20rustc.html#226642325">(Feb 17 2021 at 11:15)</a>:</h4>
<p>Hi, a question that probably has been asked and answered before, but I couldn't find a real answer nonetheless: </p>
<p>I like distribution packages and the simplicity of "zypper install rust". And I'd like to develop for the riscv32imc-unknown-none-elf target (cross-compile to it). The distribution package provides me with a rustc which can emit code for that target. Now to get things working I also need a libcore for that target. </p>
<p>I could use "rustup target add riscv32imc-unknown-none-elf" with some additional flags to use the distro-provided rustc, but then that seems to be non-ideal as well: rustup is not packaged in most distributions (and by intentionally so, it seems), and it seems to be not encouraging that use case either.</p>
<p>So the question would be: What does the rust team think of a "proper" solution there? Should distributions somehow package libcore for such targets as well? And if so, how would that work/are there examples out there doing that?</p>



<a name="226672251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Adding%20libcore%20target%20support%20to%20a%20distro-installed%20rustc/near/226672251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Adding.20libcore.20target.20support.20to.20a.20distro-installed.20rustc.html#226672251">(Feb 17 2021 at 15:25)</a>:</h4>
<p>I haven't heard of anyone doing this without either rustup or <code>-Z build-std</code>. I don't think nightly is packaged, so <code>build-std</code> won't work.</p>



<a name="226694247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Adding%20libcore%20target%20support%20to%20a%20distro-installed%20rustc/near/226694247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Adding.20libcore.20target.20support.20to.20a.20distro-installed.20rustc.html#226694247">(Feb 17 2021 at 17:34)</a>:</h4>
<p>I suspect that rustup not being packaged isn't because nobody wants it, just because it isn't trivial to package. It isn't on <a href="http://crates.io">crates.io</a> for instance.</p>



<a name="226694311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Adding%20libcore%20target%20support%20to%20a%20distro-installed%20rustc/near/226694311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Adding.20libcore.20target.20support.20to.20a.20distro-installed.20rustc.html#226694311">(Feb 17 2021 at 17:34)</a>:</h4>
<p>It's reasonable to want to install rustup via a distro package manager.</p>



<a name="226694325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Adding%20libcore%20target%20support%20to%20a%20distro-installed%20rustc/near/226694325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Adding.20libcore.20target.20support.20to.20a.20distro-installed.20rustc.html#226694325">(Feb 17 2021 at 17:34)</a>:</h4>
<p>That provides a chain of trust.</p>



<a name="226694685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Adding%20libcore%20target%20support%20to%20a%20distro-installed%20rustc/near/226694685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Adding.20libcore.20target.20support.20to.20a.20distro-installed.20rustc.html#226694685">(Feb 17 2021 at 17:36)</a>:</h4>
<p>As far as I know rustup doesn't verify the signature of the toolchains it installs.</p>



<a name="226695184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Adding%20libcore%20target%20support%20to%20a%20distro-installed%20rustc/near/226695184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Philipp Wagner <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Adding.20libcore.20target.20support.20to.20a.20distro-installed.20rustc.html#226695184">(Feb 17 2021 at 17:39)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> I got my impression after reading (your) GitHub issue <a href="https://github.com/rust-lang/rustup/issues/835">https://github.com/rust-lang/rustup/issues/835</a> and related discussions such as <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955208">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955208</a>. </p>
<p>And then I realized that actually the distro-provided rustc is fine, it's just the libcore that is missing. So if we could just build some/all libcore for the different cross-targets and include it in the distro package (or as subpackage) then <br>
there would be no need to install them after the fact at all.</p>



<a name="226698995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Adding%20libcore%20target%20support%20to%20a%20distro-installed%20rustc/near/226698995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Adding.20libcore.20target.20support.20to.20a.20distro-installed.20rustc.html#226698995">(Feb 17 2021 at 18:05)</a>:</h4>
<p>This is true. If you're working with distro rustc, the ideal scenario would be for that rustc to ship all the targets you care about.</p>



<a name="226699242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Adding%20libcore%20target%20support%20to%20a%20distro-installed%20rustc/near/226699242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Adding.20libcore.20target.20support.20to.20a.20distro-installed.20rustc.html#226699242">(Feb 17 2021 at 18:07)</a>:</h4>
<p>For instance, Debian ships <code>libstd-rust-dev-wasm32</code> and <code>libstd-rust-dev-windows</code>.</p>



<a name="226700362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Adding%20libcore%20target%20support%20to%20a%20distro-installed%20rustc/near/226700362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Philipp Wagner <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Adding.20libcore.20target.20support.20to.20a.20distro-installed.20rustc.html#226700362">(Feb 17 2021 at 18:14)</a>:</h4>
<p>Ah, great pointer! Thanks <span class="user-mention" data-user-id="239881">@Josh Triplett</span>  I didn't find those in Debian before, but that's exactly the approach I was thinking about. I'll try to adopt that to add a riscv32 libcore package.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>